package c1763;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class E {
    static Scanner cin = new Scanner(new BufferedInputStream(System.in));//大量输入优化版本
    static PrintWriter cout = new PrintWriter(new BufferedOutputStream(System.out));//大量输出优化版本
    static PrintWriter cerr = new PrintWriter(System.err, true);//开启调试模式,一般输出量不大，不需要buffered

    public static void main(String[] args) {

        int[] Q = new int[400000 + 100];
        int head = Q.length / 2, tail = head - 1;
        int n = cin.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = cin.nextInt();
        }
        for (int i = a.length - 1; i >= 0; i--) {
            if (head < tail) {
                Q[--head] = Q[tail--];
            }
            Q[--head] = a[i];
        }
        cout.println(n);
        while (head <= tail) {
            cout.print(Q[head++] + " ");
        }
        cout.println();

        cin.close();//关闭输入流
        cout.close();//关闭输出流，这是必须的，否则一般不会自动刷新缓冲区
    }
}